<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>表单序列化</title>
    <script type="text/javascript" src="../js/jquery-3.4.1.min.js"></script>
    <script>
        $(function(){
            $("#register").click(function(){
                console.log($("#registerForm").serialize())
            });
        })
    </script>
</head>
<body>
<form id="registerForm" action="#">
    用户名:<input type="text" name="username"><br>
    密码:<input type="password" name="password"><br>
    电话:<input type="text" name="phone"><br>
    地址:<input type="text" name="address"><br>
    <input type="button" id="register" value="提交">
</form>
</body>
</html>